/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.receiptaddress
 * IReceiptAddressService.java
 * 创建人:小胡 
 * 时间：2017年01月17日 16:51:55
 *
 */
package com.tz.service.receiptaddress.impl;
import com.tz.bean.ReceiptAddress;
import com.tz.bean.TzParams;
import com.tz.dao.receiptaddress.IReceiptAddressMapper;
import com.tz.service.receiptaddress.IReceiptAddressService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;

/**
 * 用户收货地址管理serviceImpl
 * IReceiptAddressService
 * 创建人:小胡 
 * 时间：2017年01月17日 16:51:55
 * @version 1.0.0
 * 
 */
@Service
public class ReceiptAddressServiceImpl implements IReceiptAddressService{

	@Autowired
	private IReceiptAddressMapper receiptaddressMapper;
	
	@Override
	public List<ReceiptAddress> findReceiptAddresss(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("a.create_time desc");
		return receiptaddressMapper.findReceiptAddresss(params);
	}
	
	@Override
	public int count(TzParams params) {
		return receiptaddressMapper.count(params);
	}

	@Override
	public HashMap<String ,Object> getReceiptAddress(Integer id) {
		return receiptaddressMapper.getReceiptAddress(id);
	}

	@Override
	public int save(ReceiptAddress receiptaddress) {
		return receiptaddressMapper.save(receiptaddress);
	}

	@Override
	public int update(ReceiptAddress receiptaddress) {
		return receiptaddressMapper.update(receiptaddress);
	}

	@Override
	public int delete(TzParams params) {
		return receiptaddressMapper.delete(params);
	}
}
